package com.dongjiantong.farmrecords.service;

import com.dongjiantong.common.web.sso.LoginInfo;
import com.dongjiantong.farmrecords.model.FarmRecordsInspection;
import com.dongjiantong.mybatis.BaseService;
import com.github.pagehelper.PageInfo;

import java.util.Map;

public interface FarmRecordsInspectionService extends BaseService<FarmRecordsInspection> {

    /**
     * 根据条件进行分页查询 (无条件表示查询全部)
     * @param pageNum
     * @param pageSize
     * @param map   查询条件
     * @return  Response<PageInfo<FarmRecordsInspection>>
     */
    PageInfo<FarmRecordsInspection> selectByMap(Integer pageNum, Integer pageSize, Map map);

    /**
     * 新建一条记录
     * @param farmRecordsInspection
     * @param toStatus
     * @return  long 返回插入数据的id
     */
    Long createOne(LoginInfo loginInfo, FarmRecordsInspection farmRecordsInspection, Integer toStatus);

    /**
     * 更新一条记录 (根据id或者number)
     * @param farmRecordsInspection
     * @return  boolean (更新成功返回true 反之返回false)
     */
    Integer updateByIdOrNumber(FarmRecordsInspection farmRecordsInspection,Integer toStatus);

    /**
     * 养殖端
     * 根据提交状态分页查询列表
     * @param farmId
     * @param status
     * @return
     */
    PageInfo<FarmRecordsInspection> selectListByStatus(Integer pageNum, Integer pageSize, Integer status, Long farmId);
}
